package com.wgchao.identityrightsmanagement.domain.organization.repository;

import com.wgchao.identityrightsmanagement.domain.BaseRepository;
import com.wgchao.identityrightsmanagement.domain.organization.model.AccountOffice;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface AccountOfficeRepository extends BaseRepository<AccountOffice, String> {
    //生成唯一标识
    public String generateCode();

    void removeByAccount(String username);

    void removeByOffice(String officeCode);

    void removeByDepartment(String departmentCode);

    /**
     * 清理部门下已经不存在的职位账户对应关系
     * @param departmentCode 部门编号
     * @param officeCodes 部门下当前职位
     * @param operator
     */
    void cleanUpIllegalCorrespondence(String departmentCode, List<String> officeCodes, String operator);
}
